//
//  TwelveViewController.m
//  项目二
//
//  Created by rimi on 16/5/17.
//  Copyright © 2016年 objective. All rights reserved.
//

#import "TwelveViewController.h"
#import "Singleton.h"
#import "Datai2ViewController.h"
@interface TwelveViewController ()
@property(nonatomic,strong) UITextField *text;


@end

@implementation TwelveViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"传值";
    [self initUIInterface];
}

- (void)initUIInterface{
    _text= [[UITextField alloc]initWithFrame:CRM(80, 100, 100, 40)];
    _text.placeholder = @"请输入传过去的值";
    _text.borderStyle = UITextBorderStyleRoundedRect;
    [self.view addSubview:_text];
    
    UIButton *surebutton = [UIButton buttonWithType:UIButtonTypeCustom];
    surebutton.frame = CRM(80, 200, 50, 50);
    surebutton.backgroundColor = [UIColor redColor];
    [surebutton setTitle:@"确定" forState:UIControlStateNormal];
    [surebutton addTarget:self action:@selector(surebuttonT:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:surebutton];
    
   
}
-(void)surebuttonT:(UIButton *)sender{
    Singleton *singleton = [Singleton sayhello];
    singleton.string = _text.text;
    Datai2ViewController *datai2 = [[Datai2ViewController alloc]init];
    [self.navigationController pushViewController:datai2 animated:YES];
    

}
@end
